FROM node:22.16-alpine as builder
# 定义工作目录
WORKDIR /app
# 将当前目录中的文件和文件夹加入到工作目录中
ADD . /app

RUN npm install && npm run build

FROM nginx:1.23-alpine-slim

COPY default.conf.template  /etc/nginx/templates/

COPY --from=builder /app/dist/ /usr/share/nginx/html/

EXPOSE 80